package vip.liux.front.infrastructure.annotations;

import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.AdviceModeImportSelector;
import org.springframework.lang.NonNull;

public class AuditedConfigurationSelector extends AdviceModeImportSelector<EnableAudited> {
    @Override
    @NonNull
    public String[] selectImports(AdviceMode adviceMode) {
        return switch (adviceMode) {
            case PROXY -> new String[]{ProxyAuditedConfiguration.class.getName()};
            // todo ASPETJ NOT SUPPORTED
            case ASPECTJ -> throw new UnsupportedOperationException("AspectJ based @Audited is not supported");
            default -> new String[]{};
        };
    }
}
